package windows;

import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SpringLayout;

public class PageSetup extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private SpringLayout parametersSpringLayout;
	private SpringLayout metadataSpringLayout;
	private SpringLayout springLayout;
	private final JLabel titleLabel = new JLabel();
	private final JTextField titleTextField = new JTextField();
	private final JLabel aliasLabel = new JLabel();
	private final JTextField aliasTextField = new JTextField();
	private final JTabbedPane tabbedPane = new JTabbedPane();
	private final JPanel metadataPanel = new JPanel();
	private final JPanel parametersPanel = new JPanel();
	private final JLabel descriptionLabel = new JLabel();
	private final JTextArea textArea = new JTextArea();
	private final JLabel keyWordsLabel = new JLabel();
	private final JTextArea textArea_1 = new JTextArea();
	private final JLabel robotsLabel = new JLabel();
	private final JTextField textField = new JTextField();
	private final JLabel authorLabel = new JLabel();
	private final JTextField textField_1 = new JTextField();
	private final JLabel authorLabel_1 = new JLabel();
	private final JTextField authorTextField = new JTextField();
	private final JLabel acceLabel = new JLabel();
	private final JComboBox accessComboBox = new JComboBox();
	private final JLabel createdDateLabel = new JLabel();
	private final JTextField textField_2 = new JTextField();
	private final JLabel startPublishingLabel = new JLabel();
	private final JTextField textField_3 = new JTextField();
	private final JLabel finishPublishingLabel = new JLabel();
	private final JTextField textField_4 = new JTextField();
	/**
	 * Create the panel
	 */
	public PageSetup() {
		super();
		try {
			jbInit();
		} catch (Throwable e) {
			e.printStackTrace();
		}
		//
	}
	private void jbInit() throws Exception {
		springLayout = new SpringLayout();
		setLayout(springLayout);
		
		add(titleLabel);
		springLayout.putConstraint(SpringLayout.NORTH, titleLabel, 15, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, titleLabel, 25, SpringLayout.WEST, this);
		titleLabel.setText("Title");
		
		add(titleTextField);
		springLayout.putConstraint(SpringLayout.SOUTH, titleTextField, 33, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.NORTH, titleTextField, 0, SpringLayout.NORTH, titleLabel);
		springLayout.putConstraint(SpringLayout.EAST, titleTextField, -30, SpringLayout.EAST, this);
		springLayout.putConstraint(SpringLayout.WEST, titleTextField, 110, SpringLayout.WEST, this);
		
		add(aliasLabel);
		springLayout.putConstraint(SpringLayout.NORTH, aliasLabel, 45, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, aliasLabel, 0, SpringLayout.WEST, titleLabel);
		aliasLabel.setText("Alias");
		
		add(aliasTextField);
		springLayout.putConstraint(SpringLayout.EAST, aliasTextField, -30, SpringLayout.EAST, this);
		springLayout.putConstraint(SpringLayout.WEST, aliasTextField, 0, SpringLayout.WEST, titleTextField);
		springLayout.putConstraint(SpringLayout.SOUTH, aliasTextField, 63, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.NORTH, aliasTextField, 0, SpringLayout.NORTH, aliasLabel);
		
		add(tabbedPane);
		springLayout.putConstraint(SpringLayout.EAST, tabbedPane, -30, SpringLayout.EAST, this);
		springLayout.putConstraint(SpringLayout.WEST, tabbedPane, 25, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, tabbedPane, -15, SpringLayout.SOUTH, this);
		springLayout.putConstraint(SpringLayout.NORTH, tabbedPane, 90, SpringLayout.NORTH, this);
		
		tabbedPane.addTab("Metadata", null, metadataPanel, null);
		metadataSpringLayout = new SpringLayout();
		metadataPanel.setLayout(metadataSpringLayout);
		
		metadataPanel.add(descriptionLabel);
		metadataSpringLayout.putConstraint(SpringLayout.NORTH, descriptionLabel, 30, SpringLayout.NORTH, metadataPanel);
		metadataSpringLayout.putConstraint(SpringLayout.WEST, descriptionLabel, 10, SpringLayout.WEST, metadataPanel);
		descriptionLabel.setText("Description");
		
		metadataPanel.add(textArea);
		metadataSpringLayout.putConstraint(SpringLayout.EAST, textArea, -20, SpringLayout.EAST, metadataPanel);
		metadataSpringLayout.putConstraint(SpringLayout.WEST, textArea, 100, SpringLayout.WEST, metadataPanel);
		metadataSpringLayout.putConstraint(SpringLayout.SOUTH, textArea, 65, SpringLayout.NORTH, metadataPanel);
		metadataSpringLayout.putConstraint(SpringLayout.NORTH, textArea, 15, SpringLayout.NORTH, metadataPanel);
		
		metadataPanel.add(keyWordsLabel);
		metadataSpringLayout.putConstraint(SpringLayout.NORTH, keyWordsLabel, 95, SpringLayout.NORTH, metadataPanel);
		metadataSpringLayout.putConstraint(SpringLayout.EAST, keyWordsLabel, 60, SpringLayout.WEST, descriptionLabel);
		metadataSpringLayout.putConstraint(SpringLayout.WEST, keyWordsLabel, 0, SpringLayout.WEST, descriptionLabel);
		keyWordsLabel.setText("Key words");
		
		metadataPanel.add(textArea_1);
		metadataSpringLayout.putConstraint(SpringLayout.EAST, textArea_1, -20, SpringLayout.EAST, metadataPanel);
		metadataSpringLayout.putConstraint(SpringLayout.WEST, textArea_1, 100, SpringLayout.WEST, metadataPanel);
		metadataSpringLayout.putConstraint(SpringLayout.SOUTH, textArea_1, 135, SpringLayout.NORTH, metadataPanel);
		metadataSpringLayout.putConstraint(SpringLayout.NORTH, textArea_1, 80, SpringLayout.NORTH, metadataPanel);
		
		metadataPanel.add(robotsLabel);
		metadataSpringLayout.putConstraint(SpringLayout.EAST, robotsLabel, 40, SpringLayout.WEST, keyWordsLabel);
		metadataSpringLayout.putConstraint(SpringLayout.WEST, robotsLabel, 0, SpringLayout.WEST, keyWordsLabel);
		metadataSpringLayout.putConstraint(SpringLayout.NORTH, robotsLabel, 152, SpringLayout.NORTH, metadataPanel);
		robotsLabel.setText("Robots");
		
		metadataPanel.add(textField);
		metadataSpringLayout.putConstraint(SpringLayout.EAST, textField, 115, SpringLayout.WEST, textArea_1);
		metadataSpringLayout.putConstraint(SpringLayout.WEST, textField, 0, SpringLayout.WEST, textArea_1);
		metadataSpringLayout.putConstraint(SpringLayout.SOUTH, textField, 170, SpringLayout.NORTH, metadataPanel);
		metadataSpringLayout.putConstraint(SpringLayout.NORTH, textField, 150, SpringLayout.NORTH, metadataPanel);
		
		metadataPanel.add(authorLabel);
		metadataSpringLayout.putConstraint(SpringLayout.EAST, authorLabel, 38, SpringLayout.WEST, robotsLabel);
		metadataSpringLayout.putConstraint(SpringLayout.WEST, authorLabel, 0, SpringLayout.WEST, robotsLabel);
		metadataSpringLayout.putConstraint(SpringLayout.NORTH, authorLabel, 182, SpringLayout.NORTH, metadataPanel);
		authorLabel.setText("Author");
		
		metadataPanel.add(textField_1);
		metadataSpringLayout.putConstraint(SpringLayout.SOUTH, textField_1, 200, SpringLayout.NORTH, metadataPanel);
		metadataSpringLayout.putConstraint(SpringLayout.NORTH, textField_1, 180, SpringLayout.NORTH, metadataPanel);
		metadataSpringLayout.putConstraint(SpringLayout.EAST, textField_1, 115, SpringLayout.WEST, textField);
		metadataSpringLayout.putConstraint(SpringLayout.WEST, textField_1, 0, SpringLayout.WEST, textField);
		
		tabbedPane.addTab("Parameters", null, parametersPanel, null);
		parametersSpringLayout = new SpringLayout();
		parametersPanel.setLayout(parametersSpringLayout);
		
		parametersPanel.add(authorLabel_1);
		parametersSpringLayout.putConstraint(SpringLayout.SOUTH, authorLabel_1, 43, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.NORTH, authorLabel_1, 27, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.WEST, authorLabel_1, 20, SpringLayout.WEST, parametersPanel);
		authorLabel_1.setText("Author");
		
		parametersPanel.add(authorTextField);
		parametersSpringLayout.putConstraint(SpringLayout.SOUTH, authorTextField, 43, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.NORTH, authorTextField, 22, SpringLayout.NORTH, parametersPanel);
		
		parametersPanel.add(acceLabel);
		parametersSpringLayout.putConstraint(SpringLayout.SOUTH, acceLabel, 86, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.NORTH, acceLabel, 70, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.EAST, acceLabel, 76, SpringLayout.WEST, authorLabel_1);
		parametersSpringLayout.putConstraint(SpringLayout.WEST, acceLabel, 0, SpringLayout.WEST, authorLabel_1);
		acceLabel.setText("Access Level");
		
		parametersPanel.add(accessComboBox);
		parametersSpringLayout.putConstraint(SpringLayout.SOUTH, accessComboBox, 86, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.NORTH, accessComboBox, 65, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.EAST, authorTextField, 175, SpringLayout.WEST, accessComboBox);
		parametersSpringLayout.putConstraint(SpringLayout.WEST, authorTextField, 0, SpringLayout.WEST, accessComboBox);
		parametersSpringLayout.putConstraint(SpringLayout.EAST, accessComboBox, 305, SpringLayout.WEST, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.WEST, accessComboBox, 130, SpringLayout.WEST, parametersPanel);
		
		parametersPanel.add(createdDateLabel);
		parametersSpringLayout.putConstraint(SpringLayout.SOUTH, createdDateLabel, 129, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.NORTH, createdDateLabel, 113, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.WEST, createdDateLabel, 0, SpringLayout.WEST, acceLabel);
		createdDateLabel.setText("Created Date");
		
		parametersPanel.add(textField_2);
		parametersSpringLayout.putConstraint(SpringLayout.SOUTH, textField_2, 129, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.NORTH, textField_2, 108, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.EAST, textField_2, 175, SpringLayout.WEST, accessComboBox);
		parametersSpringLayout.putConstraint(SpringLayout.WEST, textField_2, 0, SpringLayout.WEST, accessComboBox);
		
		parametersPanel.add(startPublishingLabel);
		parametersSpringLayout.putConstraint(SpringLayout.SOUTH, startPublishingLabel, 172, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.NORTH, startPublishingLabel, 156, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.WEST, startPublishingLabel, 0, SpringLayout.WEST, createdDateLabel);
		startPublishingLabel.setText("Start Publishing");
		
		parametersPanel.add(textField_3);
		parametersSpringLayout.putConstraint(SpringLayout.SOUTH, textField_3, 172, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.NORTH, textField_3, 151, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.EAST, textField_3, 0, SpringLayout.EAST, textField_2);
		parametersSpringLayout.putConstraint(SpringLayout.WEST, textField_3, 0, SpringLayout.WEST, textField_2);
		
		parametersPanel.add(finishPublishingLabel);
		parametersSpringLayout.putConstraint(SpringLayout.SOUTH, finishPublishingLabel, 215, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.NORTH, finishPublishingLabel, 199, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.WEST, finishPublishingLabel, 0, SpringLayout.WEST, startPublishingLabel);
		finishPublishingLabel.setText("Finish Publishing");
		
		parametersPanel.add(textField_4);
		parametersSpringLayout.putConstraint(SpringLayout.SOUTH, textField_4, 215, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.NORTH, textField_4, 194, SpringLayout.NORTH, parametersPanel);
		parametersSpringLayout.putConstraint(SpringLayout.EAST, textField_4, 0, SpringLayout.EAST, textField_3);
		parametersSpringLayout.putConstraint(SpringLayout.WEST, textField_4, 0, SpringLayout.WEST, textField_3);
	}

}
